-
Notifications
You must be signed in to change notification settings - Fork 16
Extend single-turn tune estimation to coupled lattices #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This reverts commit c3ce40e.
This test will compute tunes in an uncoupled lattice.
This example tests the BunchTuneAnalysis4D class in an uncoupled lattice.
This method returns a dictionary of phase, tune, and action for each plane for a single particle in the bunch.
|
There is also the possibility of merging this into the existing |
|
this will go in the core |
|
The original class also accounts for dispersion when normalizing: PyORBIT3/src/orbit/BunchDiagnostics/BunchTuneAnalysis.cc Lines 66 to 67 in 7671a02
To merge these classes, we could define a The naming convention for the particle attribute names could stay as "tunes_x", "tunes_y", etc. instead of "tunes_1", "tunes_2". If the user sets the normalization matrix to account for coupling, they will have to remember that these are not x and y tunes. |
|
Merged the two classes into one and updated the description above. |
xOldPhase -> phase_1 yOldPhase -> phase_2 xOldTune -> tune_1 yOldTune -> tune_2 xAction -> action_1 yAction -> action_2
|
|
To clarify: currently it is up to the user to set the normalization matrix correctly for their particular case. We could add the following methods to help the user:
Those implement the two strategies to calculate
|
This PR updates
orbit.diagnostics.TeapotTuneAnalysisNodeto handle coupled accelerator lattices.Background
This class estimates the tunes using the Average Phase Advance (APA) method [1] over one turn. The$x-x'$ phase space coordinates are normalized such that the turn-by-turn normalized coordinates $u_x-u_x'$ jump around a circle of area $A_x = 2 \pi J_x = \pi (u_x^2 + u_x'^2)$ . Here $J_x$ is the Courant-Snyder (CS) invariant, or "action". The phase $\theta_x$ is defined by
The tune$\nu_x$ is estimated from the average phase advance over $N$ turns:
This node sets$N = 1$ . The vertical pane is treated in the same way. The normalized coordinates $u_x, u_x'$ are defined as [2]:
where$\delta_p = (p - p_0) / p_0$ is the fractional momentum offset and $\{ \alpha_x, \beta_x, \eta_x \}$ are parameters set by the user (corresponding to Courant-Snyder parameters and dispersion).
Extension to coupled lattices
To extend the analysis to coupled lattices, we can define a$6 \times 6$ normalization matrix $\mathbf{V}^{-1}$ [3]:
with$\mathbf{x} = [x, x', y, y', z, \delta_p]^T$ and $\mathbf{u} = [u_1, u_1', u_2, u_2', u_3, u_3']^T$ . If the matrix is designed correctly, it will convert the one-turn transfer matrix $\mathbf{M}$ to the form:
where the$\mathbf{P}$ is a block-diagonal phase advance matrix:
The phase$\phi_k$ in mode $k$ is computed as in the 2D analysis ($\tan(\theta_k) = u_k' / u_k$ ). The tune $\nu_k$ is again estimated from the average phase advance:
And the action is given by:
Selection of normalization matrix
In a linear lattice, we can compute the$\mathbf{V}$ matrix using the eigenvectors of the transfer matrix.
For an$N$ -dimensional system ($2N$ -dimensional phase space), the eigenvectors come in $N$ pairs: $\{ \mathbf{v}_k, \mathbf{v}_k^* \}$ , where $^*$ means complex conjugate. The $\mathbf{V}$ matrix then takes the form [2]:
Alternatively, if we have a collection of particles and know that the bunch's covariance matrix$\mathbf{\Sigma} = \langle \mathbf{x} \mathbf{x}^T \rangle$ is "matched" to the transfer matrix ($\mathbf{M}\mathbf{\Sigma}\mathbf{M}^T = \mathbf{\Sigma}$ ), we can compute the eigenvectors without the transfer matrix by solving:
Here,$\varepsilon_k$ are the invariant emittances ("eigenemittances", "intrinsic emittances", "mode emittances"), whose product is the total emittance:
The$\mathbf{V}$ matrix is then constructed inform the eigenvectors in the same way as above.
Implementation
BunchTuneAnalysis.assignTwissto set elements of the normalization matrix.assignTwissfor coupled systems.ParticlePhaseAttributesto each particle. I've added methodsgetDatato extract the data from the bunch after tracking. These attributes are also written to a file along with the particle coordinates whenbunch.dumpBunchis called. (Column labels are wrong; see Issue Particle phase attribute labels printed in wrong order #78.)getTunesandgetActionsmethod to get only the tune and action data.Tests
There are examples here. These tests calculate the tunes in a FODO lattice and compare them to those calculated from the one-turn transfer matrix. There is a test for an uncoupled FODO lattice as well as a coupled lattice. The tunes are compared to the values obtained from the transfer matrix eigenvalues$\lambda_k$ :
References
[1] https://cds.cern.ch/record/292773/files/p147.pdf
[2] https://arxiv.org/pdf/1207.5526
[3] S. Y. Lee, Accelerator Physics